<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="layui-form timo-compile">
    <form th:action="@{/devices/devices/save}">
        <input type="hidden" name="id" th:if="${devices}" th:value="${devices.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">项目名称</label>
            <div class="layui-input-inline">
                 <input class="layui-input" type="text" name="title" placeholder="项目名称" th:value="${devices?.title}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设备编号</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="number" placeholder="设备编号" th:value="${devices?.number}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">设备型号</label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="0" title="施工电梯" checked>
                <input type="radio" name="type" value="1" title="物料机" th:checked="${devices?.type} eq 1">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">设备品牌</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="brand" placeholder="设备品牌" th:value="${devices?.brand}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">控制类型</label>
            <div class="layui-input-block">
                <input type="radio" name="control" value="0" title="变频" checked>
                <input type="radio" name="control" value="1" title="普机" th:checked="${devices?.control} eq 1">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">安装高度</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="height" placeholder="安装高度" th:value="${devices?.height}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">验收时间</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="date" id="laydate" placeholder="yyyy-MM-dd" th:value="${devices?.date}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">设备状态</label>
            <div class="layui-input-block">
                <input type="radio" name="state" value="0" title="正常" checked>
                <input type="radio" name="state" value="1" title="停用" th:checked="${devices?.state} eq 1">
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
    <script th:replace="/common/template :: script"></script>
    <script src="/static/build/layui.js"></script>
    <script>
        layui.use('laydate', function(){
            var laydate = layui.laydate;

//执行一个laydate实例
            laydate.render({
                elem: '#laydate' //指定元素
            });
        });
    </script>
</body>
</html>